﻿using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace WpfApp15
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }

        private int Count;

        private void Something_MouseUp(object sender, MouseButtonEventArgs e)
        {
            Count++;
            string str = $"#{Count}\r\n;   Sender:{sender};  Source:{e.Source} ";

            lbMessage.Items.Add(str);

            //e.Handled=false 可以继续向下传递
            e.Handled =(bool)cbHandled.IsChecked!;  //.net6非空检查机制，必须要强调
        }
    }
}